﻿#ifndef LED_BOARD_H
#define LED_BOARD_H

#include <QWidget>
#include <QColor>
#include "mlabel.h"

#define LED_WIDTH  980
#define LED_HEIGHT 248

class LedBoard : public QWidget
{
    Q_OBJECT
public:
    explicit LedBoard(QWidget *parent = 0);

    void    setColor(QColor bkgnd_color, QColor ft_color);
    void    setLeagueLevel(QString strLeagueLevel);
    void    setHomeIcon(QString strHomeIconFile);
    void    setHomeScore(int nHomeScore);
    void    setVistorScore(int nVisitorTeamScore);
    void    setVisitingTeamName(QString strVisitingTeamName);
    void    setElapseMatchTime(int nElapseSeconds);

    void    setVisitorNameScroll(int nEffect);
    void    setRollSpeed(int nSpeed);

    void    relayoutComponents();

protected:
    void    paintEvent(QPaintEvent *event);
    void    resizeEvent(QResizeEvent *ev);//函数声明

private:
    QRectF m_rcDiv;
    QRectF m_rcHomeIcon;
    QRectF m_rcClock;
    QRectF m_rcHomeScore;
    QRectF m_rcVistingScore;
    QRectF m_rcVistingTeam;

    QColor  m_background_color;                 // 背景颜色
    QColor  m_font_color;                       // 字体颜色

    MLabel *m_pDiv;
    MLabel *m_pHomeIcon;
    MLabel *m_pClock;
    MLabel *m_pHomeScore;
    MLabel *m_pVistingScore;
    MLabel *m_pVistingTeam;
};

#endif // LED_BOARD_H
